package com.zyh.dao.impl;

import com.zyh.dao.IUserDao;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @author cyrus
 */
// 没有名字默认是类名转小驼峰
//@Component
@Repository("userDao")
public class UserDaoImpl implements IUserDao {

    public UserDaoImpl() {
        System.out.println("类被创建...");
    }

    @Override
    public void print() {
        System.out.println("hello user!");
    }

    // 修饰的是方法
    @PostConstruct
    public void init12312312312313() {
        System.out.println("类被加载了。。。");
    }

    @PreDestroy
    public void destfdsafjkadjfkl() {
        System.out.println("类被销毁了。。。");
    }
}